All Questions
Tagged with python-3.xregex
73 questions
3votes
1answer
79views
Polynomial parsing using regular expressions in Python
I've made a code in Python 3 which converts a polynomial with integer coefficients (in simplified integer form) from string form to a list of tuples of the form (coefficient, exponent, variable). It ...
4votes
4answers
2kviews
Matching words from a text with a big list of keywords in Python
I implemented the following code to retrieve medication names from a given text (prescription_text in the code). It works by matching words in the text with a list ...
5votes
2answers
198views
Sort todo.txt items by due date in Python 3
I am using the following format for my task management: https://github.com/todotxt/todo.txt Do some stuff +uni due:2022-12-31 Write some paper +uni due:2023-01-10 ...
1vote
1answer
5kviews
A python script to download video from a website
I wrote this script for gaining experience, this script takes in a website link (NSFW) and download the video on that site. It uses regular expressions to parse the website source code to extract urls ...
1vote
1answer
180views
Password policy with regex and zxcvbn
This code snippet shows an implementation of a password policy check. - The method composition uses regex to verify that the password meets composition criteria (at least one number, one special ...
2votes
2answers
124views
Regex and pandas to read forecast sky condition string
DataFrame methods to parse the sky condition from a terminal aerodrome forecast. A line in a taf can report zero-eight cloud layers. Cloud layers are required in predominate lines, and optional in ...
3votes
1answer
55views
Replace badly formatted questionnaires in a document using regex
I have rather badly formatted questionnaires (i.e. ordered lists) in a bunch of documents that I want to clean up and replace the current version with the cleaned-up version. Example text ...
2votes
1answer
138views
Regex pattern matching to generate pandas multi index
Mostly just looking for a review of my regex and implementation of capture groups. its something I've been working to improve. The indexes have somewhat of a pattern to them of being.... ...
5votes
1answer
1kviews
Breaking Bad name generator
I've created a script to print all periodic table symbolic permutations of a string. As seen in the opening credits of each episode of Breaking Bad: © 2010-2022 AMC Networks Entertainment LLC. ...
8votes
3answers
1kviews
Filter out ambiguous bases from a DNA sequence
I have this function: ...
7votes
1answer
425views
Stop cheating on home exams using python
Background I am teaching a course at university level, and have lately been working on creating a home exam for my students. However, the institute has given clear instructions that collaboration is ...
4votes
1answer
398views
Regex to match several slightly different strings
I work with a charity that does a number of jobs, more than 100, less than 1000 a year. Jobs are identified with a year, and an up to 3 digit serial number, so ...
2votes
4answers
293views
A simplified regular expression matcher
I am working my way through some code challenges — partly to improve my problem solving, but also to improve my code quality. I think my current (fully-functional) solution to a challenge is pretty ...
4votes
1answer
4kviews
Finding Pattern Score in Python
I saw this problem in C++ on here and decided to try it in Python, which was much simpler. I've used the same problem blurb as in the link above, so they are consistent. I'm sure my code can be ...
3votes
2answers
2kviews
Date Detection with Python RegEx
its a practice project from "Automate the Boring stuff with Python" book. i am an intermediate level Python programmer and i tried to solve this problem with less code as possible. This code ...